package com.evildog.workspace.log.application.feign;


import com.evildog.workspace.common.result.Result;
import com.evildog.workspace.common.result.ResultGenerator;
import com.evildog.workspace.log.application.convert.ExceptionLogConvert;
import com.evildog.workspace.log.application.service.ExceptionLogService;
import com.evildog.workspace.log.api.feign.ExceptionLogClient;
import com.evildog.workspace.log.api.model.ExceptionLogParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * exceptionLog feign client
    异常日志
 * </p>
 *
 * @author evildog
 * @since 2020-08-29
 */
@RestController
@RequestMapping(ExceptionLogClient.API_PREFIX)
@AllArgsConstructor
@Api(tags = "exceptionLog相关接口")
public class ExceptionLogClientImpl implements ExceptionLogClient {

    private ExceptionLogService exceptionLogService;


    @Override
    @PostMapping
    @ApiOperation(value = "添加接口")
    public Result<Boolean> save(@RequestBody ExceptionLogParam exceptionLogParam) {
        return ResultGenerator.status(exceptionLogService.save(ExceptionLogConvert.INSTANCE.convert(exceptionLogParam)));
    }



}

